import axios, { AxiosRequestConfig } from 'axios'

import { IWaybillNumberRouteInfo } from './interface'
import './__mock__'

/** 获取转单号路由 */
export const apiGetWaybillNumberRouteInfo = async (
  waybillNo: string,
  signal?: AxiosRequestConfig['signal'],
): Promise<IWaybillNumberRouteInfo[]> => {
  return axios
    .post(`/tmsapi/track_waybill/getWaybillNumberRouteInfo`, { waybillNo }, { $extra: 'noAuth', signal })
    .then(res => res.$data?.waybillNumberRouteInfoList || [])
}
